aboutsummaryrefslogtreecommitdiff
path: root/src/pages/[...page].astro
diff options
context:
space:
mode:
Diffstat (limited to 'src/pages/[...page].astro')
-rw-r--r--src/pages/[...page].astro5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/pages/[...page].astro b/src/pages/[...page].astro
index cd64d66..6d513b2 100644
--- a/src/pages/[...page].astro
+++ b/src/pages/[...page].astro
@@ -8,7 +8,10 @@ import PostSummary from "../components/PostSummary.astro";
type Props = InferGetStaticPropsType<typeof getStaticPaths>;
export const getStaticPaths = (async ({ paginate }) => {
- const posts = await getCollection("blog");
+ const posts = await getCollection("blog", ({ data }) => {
+ return data.draft !== true;
+ });
+
posts.sort((a, b) => b.data.pubDate.getTime() - a.data.pubDate.getTime());
return paginate(posts, {